<?php
/***************************************************************************
 *                              quick_reply.php
 *                            -------------------
 *   begin                : Tuesday, May 4, 2004
 *   copyright            : Xpert
 *   contact              : <xpert@phpbbguru.net> http://www.phpbbguru.net
 *
 *   $Id: quick_reply.php,v 3.0.5 2007/02/24 22:38 xpert Exp $
 *
 ***************************************************************************/

/***************************************************************************
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 ***************************************************************************/

if ( !defined('IN_PHPBB') )
{
	die('Hacking attempt');
}

include($phpbb_root_path . 'includes/functions_post.'.$phpEx);

$template->set_filenames(array('quick_reply_output' => 'quick_reply.tpl'));

$attach_sig = ( $userdata['session_logged_in'] && $userdata['user_attachsig'] ) ? "checked='checked'" : '';
$notify_user = ( $can_watch_topic && ($is_watching_topic || $userdata['user_notify']) ) ? "checked='checked'" : '';
$bbcode = ( !$userdata['session_logged_in'] ) ? $board_config['allow_bbcode'] : $board_config['allow_bbcode'] && $userdata['user_allowbbcode'];
$smilies = ( !$userdata['session_logged_in'] ) ? $board_config['allow_smilies'] : $board_config['allow_smilies'] && $userdata['user_allowsmile'];

$hidden_form_fields = '<input type="hidden" name="mode" value="reply" />';
$hidden_form_fields .= '<input type="hidden" name="disable_bbcode" value="' . (!$bbcode) . '" />';
$hidden_form_fields .= '<input type="hidden" name="disable_smilies" value="' . (!$smilies) . '" />';
$hidden_form_fields .= '<input type="hidden" name="sid" value="' . $userdata['session_id'] . '" />';
$hidden_form_fields .= '<input type="hidden" name="' . POST_TOPIC_URL . '" value="' . $topic_id . '" />';

$template->assign_vars(array(
	'L_QUICK_REPLY' => $lang['QR'],
	'L_USERNAME' => $lang['Username'],
	'L_MESSAGE_BODY' => $lang['Message_body'],
	'L_ATTACH_SIGNATURE' => $lang['Attach_signature'],
	'L_NOTIFY' => $lang['Notify'],
	'L_PREVIEW' => $lang['Preview'],
	'L_SUBMIT' => $lang['Submit'],
	'L_NO_TEXT_SELECTED' => $lang['QR_no_text_selected'],
	'L_EMPTY_MESSAGE' => $lang['Empty_message'],
	'S_QUICK_REPLY_ACTION' => append_sid('posting.'.$phpEx),
	'S_ATTACH_SIGNATURE' => $attach_sig,
	'S_NOTIFY' => $notify_user,
	'S_HIDDEN_FORM_FIELDS' => $hidden_form_fields
	)
);

generate_smilies('inline', PAGE_POSTING);

$template->assign_var_from_handle('QUICK_REPLY', 'quick_reply_output');

?>